<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface>

        <composite:attribute name="descriptionDisabled"/>
        <composite:attribute name="remainderDisabled"/>
        <composite:attribute name="closedDisabled"/>

        <composite:attribute name="descriptionRequired"/>

        <composite:attribute name="descriptionCounterRendered"/>
        <composite:attribute name="remainderRendered"/>
        <composite:attribute name="remainderSearchRendered"/>
        <composite:attribute name="closedRendered"/>
        <composite:attribute name="closedSearchRendered"/>

    </composite:interface>  

    <h:panelGrid columns="1"
                 columnClasses="columnWidth100"
                 width="90%"
                 style="margin-left: auto; margin-right: auto">  

        <p:outputLabel value="#{bundle.Description}" 
                       for="description"/>    

        <p:inputTextarea id="description"
                         style="width: 100%"
                         value="#{organizationNoteController.selected.description}"
                         tabindex="01"
                         maxlength="512"
                         counterTemplate="#{bundle.RemainingCharacters}: {0}"
                         counter="descriptionCounter"
                         disabled="#{cc.attrs.descriptionDisabled}"
                         required="#{cc.attrs.descriptionRequired}"/>

        <h:panelGrid columns="2"
                     columnClasses="columnWidth50, columnWidth50"
                     width="100%"
                     style="margin-left: auto; margin-right: auto; text-align: right">

            <h:panelGrid columns="2"
                         columnClasses="columnWidth50, columnWidth50"
                         width="100%"
                         style="margin-left: auto; margin-right: auto; text-align: left">

                <p:outputLabel value="#{bundle.Remainder}" 
                               for="remainder"/>  

                <p:calendar id="remainder"
                            styleClass="calendarStyle"
                            value="#{organizationNoteController.selected.remainder}"
                            tabindex="02"
                            effect="fade" 
                            showWeek="true"
                            showButtonPanel="true"
                            locale="#{localizationUtil.selected}"
                            pattern="#{localizationUtil.dateFormatMediumPattern}"
                            timeZone="#{localizationUtil.defaultTimeZone}"
                            disabled="#{cc.attrs.remainderDisabled}"
                            rendered="#{cc.attrs.remainderRendered}"/>

                <p:inputText id="remainderSearch"
                             style="width: 100%"
                             value="#{organizationNoteController.remainderSearch}"
                             tabindex="11"
                             rendered="#{cc.attrs.remainderSearchRendered}"/>         

                <p:outputLabel value="#{bundle.Closed}" 
                               for="closed"/>

                <p:selectBooleanCheckbox id="closed"
                                         style="vertical-align: -22%"
                                         value="#{organizationNoteController.selected.closed}"
                                         tabindex="03"
                                         disabled="#{cc.attrs.closedDisabled}"
                                         rendered="#{cc.attrs.closedRendered}"/> 

                <p:selectOneMenu id="closedSearch"
                                 style="width: 100%"
                                 value="#{organizationNoteController.closedSearch}"
                                 tabindex="03"
                                 rendered="#{cc.attrs.closedSearchRendered}">

                    <f:selectItem itemLabel="#{bundle.Both}" itemValue="b"/>
                    <f:selectItem itemLabel="#{bundle.Yes}" itemValue="t"/>
                    <f:selectItem itemLabel="#{bundle.No}" itemValue="f"/>

                </p:selectOneMenu>        

            </h:panelGrid> 

            <p:spacer rendered="#{!cc.attrs.descriptionCounterRendered}"/>

            <p:outputLabel id="descriptionCounter"
                           style="font-size: small"
                           rendered="#{cc.attrs.descriptionCounterRendered}"/>      

        </h:panelGrid>

    </h:panelGrid>

    <p:dialog header="#{bundle.AdditionalInfo}"
              widgetVar="additionalInfoDialog" 
              resizable="false" 
              modal="true" 
              showEffect="fade"
              hideEffect="fade" 
              draggable="false"
              width="48%"
              style="margin-left: auto; margin-right: auto">

        <h:panelGrid columns="3"
                     columnClasses="columnWidth48, columnWidth4, columnWidth48"
                     width="90%"
                     style="margin-left: auto; margin-right: auto">

            <h:panelGrid columns="1"
                         columnClasses="columnWidth100"
                         rowClasses="rowAlign"
                         width="100%">

                <p:outputLabel value="#{bundle.Id}" 
                               for="id"/>

                <p:inputText id="id"
                             style="width: 100%; margin-bottom: 2%"
                             value="#{organizationNoteController.selected.id}"
                             disabled="true"/>         

                <p:outputLabel value="#{bundle.CreatedBy}" 
                               for="createdBy"/>

                <p:inputText id="createdBy" 
                             style="width: 100%; margin-bottom: 2%"
                             value="#{organizationNoteController.selected.createdBy.name}"
                             disabled="true"/>

                <p:outputLabel value="#{bundle.UpdatedBy}" 
                               for="updatedBy"/>

                <p:inputText id="updatedBy"   
                             style="width: 100%"
                             value="#{organizationNoteController.selected.updatedBy.name}"
                             disabled="true"/>         

            </h:panelGrid>

            <p:spacer/>

            <h:panelGrid columns="1"
                         columnClasses="columnWidth100"
                         rowClasses="rowAlign"
                         width="100%">

                <p:spacer/>

                <p:spacer style="margin-bottom: 12.2%"/>        

                <p:outputLabel value="#{bundle.Created}" 
                               for="created"/>

                <p:inputText id="created"
                             style="width: 100%; margin-bottom: 2%"
                             value="#{organizationNoteController.selected.created}"
                             disabled="true">

                    <f:convertDateTime 
                        locale="#{localizationUtil.selected}" 
                        type="both"
                        pattern="#{localizationUtil.dateTimeFormatMediumPattern}" 
                        timeZone="#{localizationUtil.defaultTimeZone}"/>      

                </p:inputText>  

                <p:outputLabel value="#{bundle.Updated}" 
                               for="updated"/>

                <p:inputText id="updated"
                             style="width: 100%"
                             value="#{organizationNoteController.selected.updated}"
                             disabled="true">

                    <f:convertDateTime 
                        locale="#{localizationUtil.selected}" 
                        type="both"
                        pattern="#{localizationUtil.dateTimeFormatMediumPattern}" 
                        timeZone="#{localizationUtil.defaultTimeZone}"/>

                </p:inputText>         

            </h:panelGrid>    

        </h:panelGrid>

    </p:dialog>     

</html>